package org.jeecg.modules.ec.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * @Description: 服务商管理
 * @Author: jeecg-boot
 * @Date:   2025-09-02
 * @Version: V1.0
 */
@Data
@TableName("ec_service_provider")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description="服务商管理")
public class EcServiceProvider implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private String id;
	/**创建人*/
    @Schema(description = "创建人")
    private String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建日期")
    private Date createTime;
	/**更新人*/
    @Schema(description = "更新人")
    private String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新日期")
    private Date updateTime;
	/**所属部门*/
    @Schema(description = "所属部门")
    private String sysOrgCode;
	/**LOGO*/
	@Excel(name = "LOGO", width = 15)
    @Schema(description = "LOGO")
    private String logo;
	/**营业执照*/
	@Excel(name = "营业执照", width = 15)
    @Schema(description = "营业执照")
    private String businessLicense;
	/**服务商名称*/
	@Excel(name = "服务商名称", width = 15)
    @Schema(description = "服务商名称")
    private String serviceProviderName;
	/**服务商类别*/
	@Excel(name = "服务商类别", width = 15, dicCode = "service_provider_category")
	@Dict(dicCode = "service_provider_category")
    @Schema(description = "服务商类别")
    private String serviceProviderCategory;
	/**服务商类型*/
	@Excel(name = "服务商类型", width = 15, dicCode = "service_provider_type")
	@Dict(dicCode = "service_provider_type")
    @Schema(description = "服务商类型")
    private String serviceProviderType;
	/** 统一社会信用代码*/
	@Excel(name = " 统一社会信用代码", width = 15)
    @Schema(description = " 统一社会信用代码")
    private String businessLicenseNumber;
	/**归属区域*/
    @Excel(name = "归属区域", width = 15,exportConvert=true,importConvert = true )
    @Schema(description = "归属区域")
    private String region;

    public String convertisRegion() {
        return SpringContextUtils.getBean(ProvinceCityArea.class).getText(region);
    }

    public void convertsetRegion(String text) {
        this.region = SpringContextUtils.getBean(ProvinceCityArea.class).getCode(text);
    }
	/**负责人*/
	@Excel(name = "负责人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
	@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
    @Schema(description = "负责人")
    private String personInCharge;
	/**手机号*/
	@Excel(name = "手机号", width = 15)
    @Schema(description = "手机号")
    private String phone;
	/**固话号码*/
	@Excel(name = "固话号码", width = 15)
    @Schema(description = "固话号码")
    private String fixedLinePhoneNumber;
	/**邮箱*/
	@Excel(name = "邮箱", width = 15)
    @Schema(description = "邮箱")
    private String email;
	/**法人代表*/
	@Excel(name = "法人代表", width = 15)
    @Schema(description = "法人代表")
    private String legalRepresentative;
	/**法人身份证正面*/
	@Excel(name = "法人身份证正面", width = 15)
    @Schema(description = "法人身份证正面")
    private String frontSideOfIdcard;
	/**法人身份证反面*/
	@Excel(name = "法人身份证反面", width = 15)
    @Schema(description = "法人身份证反面")
    private String idcardBack;
	/**结算方式*/
	@Excel(name = "结算方式", width = 15, dicCode = "payment_method")
	@Dict(dicCode = "payment_method")
    @Schema(description = "结算方式")
    private String paymentMethod;
	/** 结算周期*/
	@Excel(name = " 结算周期", width = 15, dicCode = "billing_cycle")
	@Dict(dicCode = "billing_cycle")
    @Schema(description = " 结算周期")
    private String billingCycle;
	/**开户行*/
	@Excel(name = "开户行", width = 15)
    @Schema(description = "开户行")
    private String bankOfDeposit;
	/** 银行卡号*/
	@Excel(name = " 银行卡号", width = 15)
    @Schema(description = " 银行卡号")
    private String bankCardNumber;
}
